
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>{$Think.config.site.title} - 经营设置</title>

    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
    <link rel="shortcut icon" href="favicon.ico"> <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="{$Think.config.site.resource_url}css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="{$Think.config.site.resource_url}css/demo/webuploader-demo.css">
    <link href="{$Think.config.site.resource_url}css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="{$Think.config.site.resource_url}css/plugins/markdown/bootstrap-markdown.min.css" />
    <link href="{$Think.config.site.resource_url}css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
    <div class="row">
        <div class="col-sm-12">
            <!--                 <div class="ibox-title">
                <h5>经营基本信息设置 <small class="m-l-sm"></small></h5>
            </div> -->
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">{:lang('基本信息')}</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">{:lang('运营信息')}</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">{:lang('注册协议')}</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">{:lang('充值协议')}</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">{:lang('用户协议')}</a></li>
                    <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">{:lang('隐私协议')}</a></li>
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body col-sm-12">
                            <form class="form-horizontal m-t"  method="post" id="Myform" enctype="multipart/form-data">
                                <div class=" col-sm-6">
                                    <div class="form-group">
                                        <h3>　{:lang('代理商名称')}：</h3>
                                        <p>　{:lang('输入')}{:lang('代理商名称')}</p>
                                        <div class="col-xs-6">
                                            <input id="name" name="name" minlength="2" type="text" class="form-control" required="" value="{$base.name}" aria-required="true">

                                        </div>
                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　LOGO：</h3>
                                        <p>　{:lang('上传小程序LOGO图标')}</p>
                                        <div class="col-xs-6">
                                            <input class="file" id="file" type="file" name="logo" multiple="" data-min-file-count="1" >
                                            <img src="{$Think.config.qcloudurl,$base.logo}" alt="" width="120" height="auto">
                                        </div>
                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　{:lang('域名')}：</h3>
                                        <p>　{:lang('输入网站网址')}:http://www:****.com</p>
                                        <div class="col-xs-6">
                                            <input id="addrs" type="text" class="form-control" name="domain" required="" aria-required="true" value="{$base.domain}" >
                                        </div>

                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　{:lang('联系人')}：</h3>
                                        <p>　{:lang('填写联系人昵称或者姓名')}</p>
                                        <div class="col-xs-6">
                                            <input id="contacts" type="text" class="form-control" name="contacts" required="" aria-required="true" value="{$base.contacts}">
                                        </div>
                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　{:lang('联系电话')}：</h3>
                                        <p>　{:lang('填写联系人电话号码')}</p>
                                        <div class="col-xs-6">
                                            <input id="mobile" type="text" class="form-control" name="mobile" required="" aria-required="true" value="{$base.mobile}" >
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <h3>　{:lang('是否绑定手机号')}：</h3>
                                        <p>　{:lang('设置是否需要客户绑定手机号')}</p>
                                        <div class="col-xs-4">
                                            <div class="radio radio-info radio-inline">
                                                <input type="radio" id="bindmobile1" value="1" name="bindmobile" {if condition="$base.bindmobile eq '1'"} checked="checked"{/if} >
                                                <label for="inlineRadio1"> {:lang('需要')} </label>
                                            </div>
                                            <div class="radio radio-inline">
                                                <input type="radio" id="bindmobile0" value="0" name="bindmobile" {if condition="$base.bindmobile eq '0'"} checked="checked"{/if}>
                                                <label for="inlineRadio2"> {:lang('不需要')} </label>
                                            </div>
                                        </div>
                                    </div>
                                    <hr>

                                    <input type="hidden" name="id" value="{$base.id}">

                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <h3>　{:lang('客服电话')}：</h3>
                                        <p>　{:lang('在线客服电话号码')}</p>
                                        <div class="col-xs-6">
                                            <input id="servicephone" type="text" class="form-control" name="servicephone" required="" aria-required="true" value="{$base.servicephone}" >
                                        </div>
                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　{:lang('地址')}：</h3>
                                        <p>　{:lang('联系地址')}</p>
                                        <div class="col-xs-6">
                                            <input id="addrs" type="text" class="form-control" name="addrs" required="" aria-required="true" value="{$base.addrs}" >
                                        </div>

                                    </div>
                                    <hr>
                                    <div class="form-group">
                                        <h3>　{:lang('用户端显示附近商户的距离')}：</h3>
                                        <p>　{:lang('小程序端显示附近')} <?php echo (int)$base['distance'];?> {:lang('公里距离的商户')}</p>
                                        <div class="col-xs-6">
                                            <input id="distance" type="number"  step="0.01" class="form-control" name="distance" required="" aria-required="true" value="{$base.distance ?? ''}" >
                                        </div>

                                    </div>
                                    <hr>
                                    <div class="ibox float-e-margins">
                                        <div class="ibox-title" style="border-color:#fff">
                                            <h5>{:lang('小程序简介')}</h5>
                                        </div>
                                        <div class="ibox-content">
                                            <textarea name="introduce" data-provide="markdown" rows="15" required="" aria-required="true">{$base.introduce}</textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-12">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <div class="col-xs-4">
                                                <button class="btn btn-primary"  type="button" id="onbtons">提交</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body col-sm-12" >
                            <form class="form-horizontal m-t col-sm-6" id="commentForm1" name="myform2" enctype="multipart/form-data" method="post">
                                <div class="form-group">
                                    <h3>　{:lang('押金')}：</h3>
                                    <p>　{:lang('设置押金金额')}</p>
                                    <div class="col-xs-4">
                                        <input id="deposit" name="deposit"  type="text" class="form-control" required="" aria-required="true" value="{$base.deposit}">
                                        <input type="hidden" name="id" value="{$base.id}">
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <h3>　{:lang('押金延迟')}：</h3>
                                    <p>　{:lang('还回充电宝后多久可以退换押金，单位分钟')}</p>
                                    <div class="col-xs-4">
                                        <input id="deposit_delay" name="deposit_delay"  type="text" class="form-control" required="" aria-required="true" value="{$base.deposit_delay}">
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <h3>　{:lang('可充值金额')}：</h3>
                                    <p>　{:lang('默认支持4个充值金额')}</p>
                                    <?php 
                                            $days_array=explode('|',$base['prepaidamount']); 
                                             foreach ($days_array as $v){

                                             echo '<div class="col-xs-2">
                                    <input id="cname" name="prepaidamount[]"  type="text" class="form-control" required="" aria-required="true"'." value='$v' >".'</div>';
                                }

                                ?>
                        </div>
                        <hr>
                        <div class="form-group">
                            <h3>　{:lang('每日最高消费')}：</h3>
                            <p>　{:lang('设置每日最高消费限额,超出时长按照最高消费金额来算')}.</p>
                            <div class="col-xs-4">
                                <input id="ceiling" name="ceiling"  type="text" class="form-control" required="" aria-required="true" value="{$base.ceiling ?? ''}">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <h3>　{:lang('免费时长')}：</h3>
                            <p>　{:lang('用户每次租借前多少分钟免费，0表示没有免费时长')}.</p>
                            <div class="col-xs-4">
                                <input id="freetime" name="freetime"  type="text" class="form-control" required="" aria-required="true" value="{$base.freetime ?? ''}">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <h3>　{:lang('计费时长')}：</h3>
                            <p>　{$base.billingtime} {:lang('表示:')} {$base.billingtime} {:lang('小时')} {:lang('或者')} {$base.billingtime} {:lang('分钟计费')}（{:lang('和计费单位相关联')}）</p>
                            <div class="col-xs-2">
                                <input id="billingtime" name="billingtime"  type="text" class="form-control" required="" aria-required="true" value="{$base.billingtime}">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <h3>　{:lang('单位价格')}：</h3>
                            <p>　{:lang('如:2/小时计费')} {$base.amount} {:lang('元')}</p>
                            <div class="col-xs-2">
                                <input id="amount" name="amount"  type="text" class="form-control" required="" aria-required="true" value="{$base.amount}">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <h3>　{:lang('计费单位')}：</h3>
                            <p>　{:lang('设置计费单位')}</p>
                            <div class="col-xs-4">
                                <div class="radio radio-info radio-inline">
                                    <input type="radio" id="inlineRadio1" value="1" name="billingunit" {if condition="$base.billingunit eq '1'"} checked="checked"{/if} >
                                    <label for="inlineRadio1"> {:lang('小时')} </label>
                                </div>
                                <div class="radio radio-inline">
                                    <input type="radio" id="inlineRadio2" value="2" name="billingunit" {if condition="$base.billingunit eq '2'"} checked="checked"{/if}>
                                    <label for="inlineRadio2"> {:lang('分钟')} </label>
                                </div>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <div class="col-xs-4">
                                <button class="btn btn-primary" id="submit2" type="button">{:lang('提交')}</button>
                            </div>
                        </div>
                        </form>
                    </div>
                </div>
                <div id="tab-3" class="tab-pane">
                    <form class="form-horizontal m-t" name="myform3" id="commentForm3" method="post" action="<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/agreement">
                        <div class="panel-body col-sm-10">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>{:lang('注册协议')}</h5>
                                </div>
                                <input type="hidden" name="id" value="{$xy.id}">
                                <div class="ibox-content">
                                    <textarea name="xy1" data-provide="markdown" rows="20">{$xy.xy1}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-1 col-sm-offset">
                                    <button class="btn btn-primary zcxy" type="button" data-id="1">{:lang('提交')}</button>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
                <div id="tab-4" class="tab-pane">
                    <form class="form-horizontal m-t" name="myform4" id="commentForm4" method="post" action="<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/agreement">
                        <div class="panel-body col-sm-10">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>{:lang('充值协议')}</h5>
                                </div>
                                <input type="hidden" name="id" value="{$xy.id}">
                                <div class="ibox-content">
                                    <textarea name="xy2" data-provide="markdown" rows="20">{$xy.xy2}</textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-1 col-sm-offset">
                                    <button class="btn btn-primary zcxy" type="button" data-id="2">{:lang('提交')}</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div id="tab-5" class="tab-pane">
                    <form class="form-horizontal m-t" name="myform5" id="commentForm5" method="post" action="">
                        <div class="panel-body col-sm-10">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>{:lang('用户协议')}</h5>
                                </div>
                                <input type="hidden" name="id" value="{$xy.id}">
                                <div class="ibox-content">
                                    <textarea name="xy3" data-provide="markdown" rows="20">{$xy.xy3}</textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-1 col-sm-offset">
                                    <button class="btn btn-primary zcxy" type="button" data-id="3">{:lang('提交')}</button>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
                <div id="tab-6" class="tab-pane">
                    <form class="form-horizontal m-t" name="myform6" id="commentForm6" method="post" action="<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/agreement">
                        <div class="panel-body col-sm-10">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>{:lang('隐私声明')}</h5>
                                </div>
                                <input type="hidden" name="id" value="{$xy.id}">
                                <div class="ibox-content">
                                    <textarea name="xy4" data-provide="markdown" rows="20">{$xy.xy4}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-1 col-sm-offset">
                                    <button class="btn btn-primary zcxy" type="button" data-id="4">{:lang('提交')}</button>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
            </div>


        </div>
    </div>
</div>
</div>


<!-- 全局js -->
<script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
<script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="{$Think.config.site.resource_url}js/content.js?v=1.0.0"></script>
<!-- jQuery Validation plugin javascript-->
<script src="{$Think.config.site.resource_url}js/plugins/validate/jquery.validate.min.js"></script>
<script src="{$Think.config.site.resource_url}js/plugins/validate/messages_zh.min.js"></script>
<script src="{$Think.config.site.resource_url}js/demo/form-validate-demo.js"></script>

<!-- simditor -->
<script type="text/javascript" src="{$Think.config.site.resource_url}js/plugins/markdown/markdown.js"></script>
<script type="text/javascript" src="{$Think.config.site.resource_url}js/plugins/markdown/to-markdown.js"></script>
<script type="text/javascript" src="{$Think.config.site.resource_url}js/plugins/markdown/bootstrap-markdown.js"></script>
<script type="text/javascript" src="{$Think.config.site.resource_url}js/plugins/markdown/bootstrap-markdown.zh.js"></script>
<script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
<script type="text/javascript">
    $(function(){

        $('#onbtons').click(function(){
            //alert(1234);
            var formData = new FormData($("#Myform")[0]);
            $.ajax({
                type : 'POST',
                url  : '<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/edit',
                dataType : 'json',
                data: formData,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (result) {
                    if(0 === result.code) {
                        layer.msg(result.msg, {icon: 1});
                        window.location.reload();
                    }else{
                        layer.msg(result.msg, {icon: 5});
                    }
                },
                error: function () {
                    layer.msg("{:lang('服务器错误！请稍后重试')}", {icon: 2});
                }
            })
        });
        $('#submit2').click(function(){
            var formdata = $('#commentForm1').serialize();
            $.ajax({
                type : 'POST',
                url  : '<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/yxinfo',
                dataType : 'json',
                data : formdata,
                async : false,
                success : function(result){
                    if(0 == result.code){
                        layer.msg(result.msg, {icon: 1});
                        window.location.reload();
                    }else{
                        layer.msg(result.msg, {icon: 5});
                    }
                },
                error : function(){
                    layer.msg("{:lang('服务器错误！请稍后重试')}", {icon: 2});
                }
            })
        });

        $('.zcxy').click(function(){
            var id = $(this).data('id');
            if(id==1){
                var formdata = $('#commentForm3').serialize();
            }else if(id==2){
                var formdata = $('#commentForm4').serialize();
            }else if(id==3){
                var formdata = $('#commentForm5').serialize();
            }else if(id==4){
                var formdata = $('#commentForm6').serialize();
            }
            $.ajax({
                type : 'POST',
                url  : '<?php echo \think\Request::instance()->root(); ?>/ausadmin/Jysetting/agreement',
                dataType : 'json',
                data : formdata,
                async : false,
                success : function(result){
                    if(0 == result.code){
                        layer.msg(result.msg, {icon: 1});
                        window.location.reload();
                    }else{
                        layer.msg(result.msg, {icon: 5});
                    }
                },
                error : function(){
                    layer.msg("{:lang('服务器错误！请稍后重试')}", {icon: 2});
                }
            })
            //alert(id);
        });
    });
</script>
<!-- Web Uploader -->
<script type="text/javascript">
    // 添加全局站点信息
    var BASE_URL = '{$Think.config.site.resource_url}js/plugins/webuploader';
</script>
<script src="{$Think.config.site.resource_url}js/plugins/webuploader/webuploader.min.js"></script>
<script src="{$Think.config.site.resource_url}js/demo/webuploader-demo.js"></script>

</body>

</html>
